/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package query;
import model.Siswa;
import java.sql.Connection;
import dao.siswaDAO;
import java.net.ConnectException;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.util.List;

/**
 *
 * @author LOBA
 */
public class SiswaQuery implements siswaDAO{

    public SiswaQuery(Connection con) {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }
    @Override
    public void insertSiswa(String nis, String nama, String alamat, String noTelp) {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }

    @Override
    public void insertSiswa(Siswa sw) {
        String sql = "INSERT INTO tb_siswa VALUES (?,?,?,?)";
        try {
PreparedStatement st = conn.prepareStatement(sql);
st.setString(1, sw.getNIS());
st.setString(2, sw.getNama());
st.setString(3, sw.getAlamat());
st.setString(4, sw.getIDTelp());
st.executeUpdate();
} catch (SQLException ex) {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }

   

